<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>在线OJ平台 - 题目列表</title>
    <link rel="icon" type="image/x-icon" href="../wwwroot/yaya.png">

    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: Arial, sans-serif;
        }

        body {
            background-color: #181818;
            color: #fff;
            display: flex;
            justify-content: center;
            align-items: flex-start;
            min-height: 100vh;
            margin: 0;
            flex-wrap: wrap;
            align-content: flex-start;
        }

        .container {
            width: 80%;
            max-width: 1000px;
            padding: 10px;
        }

        .navbar {
            width: 100%;
            height: 50px;
            background-color: black;
            /* 给父级标签设置overflow，取消后续float带来的影响 */
            overflow: hidden;
        }

        .navbar a {
            /* 设置a标签是行内块元素，允许你设置宽度 */
            display: inline-block;
            /* 设置a标签的宽度,a标签默认行内元素，无法设置宽度 */
            width: 80px;
            /* 设置字体颜色 */
            color: white;
            /* 设置字体的大小 */
            font-size: large;
            /* 设置文字的高度和导航栏一样的高度 */
            line-height: 50px;
            /* 去掉a标签的下划线 */
            text-decoration: none;
            /* 设置a标签中的文字居中 */
            text-align: center;
        }

        /* 设置鼠标事件 */
        .navbar a:hover {
            background-color: green;
        }

        .navbar .login {
            float: right;
        }


        .header {
            display: flex;
            justify-content: flex-start;
            margin-bottom: 20px;
        }

        .search-box {
            width: 50%;
            padding: 10px;
            border: none;
            border-radius: 5px;
            background-color: #2b2b2b;
            color: #fff;
            font-size: 1rem;
        }

        .problem-list table {
            width: 100%;
            border-collapse: collapse;
            background-color: #2b2b2b;
            border-radius: 8px;
            overflow: hidden;
        }

        .problem-list th,
        .problem-list td {
            padding: 12px 15px;
            text-align: left;
        }

        .problem-list th {
            background-color: #333;
        }

        .problem-list tr:nth-child(even) {
            background-color: #222;
        }

        .problem-list .status {
            width: 15px;
            height: 15px;
            border-radius: 50%;
            display: inline-block;
        }

        .icon-pending {
            background-color: #ffc107;
        }

        .icon-solved {
            background-color: #28a745;
        }

        .icon-unsolved {
            background-color: #dc3545;
        }

        .difficulty {
            padding: 4px 8px;
            border-radius: 5px;
            font-size: 0.9rem;
        }

        .easy {
            background-color: #28a745;
            color: #fff;
        }

        .medium {
            background-color: #ffc107;
            color: #fff;
        }

        .hard {
            background-color: #dc3545;
            color: #fff;
        }

        .item {
            height: 40px;
            font-size: large;
            font-family: 'Times New Roman', Times, serif;
        }

        .item a {
            text-decoration: none;
            color: white;
        }

        .item a:hover {
            color: blue;
            text-decoration: underline;
        }
    </style>
</head>

<body>
    <div class="navbar">
        <a href="/">首页</a>
        <a href="/all_questions">题库</a>
        <a href="#">竞赛</a>
        <a href="#">讨论</a>
        <a href="#">求职</a>
        <a class="login" href="#">登录</a>
    </div>
    <div class="container">

        <header class="header">
            <input type="text" class="search-box" placeholder="搜索题目...">
        </header>

        <main class="problem-list">
            <table>
                <thead>
                    <tr>
                        <th>状态</th>
                        <th>题号</th>
                        <th>题目</th>
                        <th>难度</th>
                    </tr>
                </thead>
                <tbody>
                    {{#question_list}}
                    <tr>
                        <td><span class="status icon-pending"></span></td>
                        <td>{{number}}</td>
                        <td class="item"><a href="/question/{{number}}">{{title}}</a></td>
                        <td><span class="difficulty easy">{{star}}</span></td>
                    </tr>
                    {{/question_list}}
                </tbody>
            </table>
        </main>
    </div>
</body>

</html>